package com.lp.chapter001.handler.easyexcel;

import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.read.listener.ReadListener;

/**
 * easyExcel读取总条数处理器
 * @author LP to 2024/04/02
 */
public class EasyExcelTotalNumImportHandler<T> implements ReadListener<T> {

    private int rowCount = 0;

    @Override
    public void invoke(T t, AnalysisContext analysisContext) {
        rowCount++;
    }

    @Override
    public void doAfterAllAnalysed(AnalysisContext analysisContext) {

    }

    public int getTotalRow() {
        return rowCount;
    }
}
